// 1. createStore 用来创建全局状态的方法
import { legacy_createStore as createStore, combineReducers } from 'redux'

// 导入两个状态模块
import appreducer from './modules/app'
import proreducer from './modules/pro'


// ？
// 需要想办法将两个 reducer 合并成一个 
const reducer = combineReducers({
    app: appreducer,
    pro: proreducer
})

// 3. 通过 createStore 来创建一个状态管理器
const store = createStore(reducer)

// 4. 将 store 导出去
export default store